//
$(document).ready(function() 
{
	// accordion effect on frontpage navigation
	var subs = $('.navigation').children('li');
	
	subs.bind('click', function(e) {
		var currentSub = $(e.target).closest('li');

		if (!currentSub.children('.sub').is(':visible')) {		
			for (var i = 0; i < subs.length; i++) {
				if (currentSub != subs[i]) {
					$(subs[i]).children('.sub').slideUp('fast');
					$(subs[i]).removeClass('open');
					$(subs[i]).addClass('closed');
				}
			}
		}

		currentSub.children('.sub').slideDown('fast');
		currentSub.removeClass('closed');
		currentSub.addClass('open');
		
		return false;
	});
});
